/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('composer', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CloneFlowRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow that you want to clone.', example='lc-uf6yrfwxpe6wkw'),
  versionId?: string(name='VersionId', description='The version of the workflow that you want to clone. If you do not specify this parameter, the latest version of the workflow is cloned.', example='10'),
}

model CloneFlowResponseBody = {
  flowId?: string(name='FlowId', description='The ID of the cloned workflow.', example='lc-uf6wvbsyvvl5sy'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
}

model CloneFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CloneFlowResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param request CloneFlowRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return CloneFlowResponse
 */
// Deprecated
async function cloneFlowWithOptions(request: CloneFlowRequest, runtime: Util.RuntimeOptions): CloneFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!Util.isUnset(request.versionId)) {
    body['VersionId'] = request.versionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request CloneFlowRequest
  * @return CloneFlowResponse
 */
// Deprecated
async function cloneFlow(request: CloneFlowRequest): CloneFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return cloneFlowWithOptions(request, runtime);
}

model CreateFlowRequest {
  definition?: string(name='Definition', description='The definition of the workflow, which must be a JSON string.', example='{\\"schemaVersion\\":\\"2018-12-12\\",\\"actions\\":{},\\"version\\":\\"1.0.0\\",\\"triggers\\":{}}'),
  flowDescription?: string(name='FlowDescription', description='The description of the workflow.', example='This is a workflow.'),
  flowName?: string(name='FlowName', description='The name of the workflow.', example='test'),
  flowSource?: string(name='FlowSource', description='The source of the workflow. Valid values:

*   Default: Create the workflow in the console.
*   CloudConfig: Create the workflow by using Cloud Config.
*   Solution: Create the workflow by using Logic Composer.', example='Default'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzmrjn4nsszna'),
  templateId?: string(name='TemplateId', description='The ID of the template.', example='tp-uf6tbvhheciyxl'),
}

model CreateFlowResponseBody = {
  flowId?: string(name='FlowId', description='The ID of the created workflow.', example='lc-utf6abcdefg'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D264C934-2DA8-44B4-B034-C659A63AC659'),
}

model CreateFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateFlowResponseBody(name='body'),
}

/**
  * After you create a workflow, the system automatically creates a version for the workflow. You can call the GetVersion operation to obtain the version information.
  *
  * @param request CreateFlowRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return CreateFlowResponse
 */
async function createFlowWithOptions(request: CreateFlowRequest, runtime: Util.RuntimeOptions): CreateFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.definition)) {
    body['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.flowDescription)) {
    body['FlowDescription'] = request.flowDescription;
  }
  if (!Util.isUnset(request.flowName)) {
    body['FlowName'] = request.flowName;
  }
  if (!Util.isUnset(request.flowSource)) {
    body['FlowSource'] = request.flowSource;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.templateId)) {
    body['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * After you create a workflow, the system automatically creates a version for the workflow. You can call the GetVersion operation to obtain the version information.
  *
  * @param request CreateFlowRequest
  * @return CreateFlowResponse
 */
async function createFlow(request: CreateFlowRequest): CreateFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFlowWithOptions(request, runtime);
}

model DeleteFlowRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow that you want to delete.', example='lc-uf6wvbsyvvl5sy'),
}

model DeleteFlowResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values: **true**: The operation was successful. **false**: The operation failed.', example='true'),
}

model DeleteFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteFlowResponseBody(name='body'),
}

/**
  * If you delete a workflow, all the versions and execution records of the workflow are automatically deleted.
  *
  * @param request DeleteFlowRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return DeleteFlowResponse
 */
async function deleteFlowWithOptions(request: DeleteFlowRequest, runtime: Util.RuntimeOptions): DeleteFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * If you delete a workflow, all the versions and execution records of the workflow are automatically deleted.
  *
  * @param request DeleteFlowRequest
  * @return DeleteFlowResponse
 */
async function deleteFlow(request: DeleteFlowRequest): DeleteFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFlowWithOptions(request, runtime);
}

model DisableFlowRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow that you want to disable.', example='lc-uf6pvud38xl0ia'),
}

model DisableFlowResponseBody = {
  flowStatus?: string(name='FlowStatus', description='The status of the workflow.

*   **Enabled**: The workflow is enabled.
*   **Disabled**: The workflow is disabled.', example='Disabled'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful.

*   **true**: The operation was successful.
*   **false**: The operation failed.', example='true'),
}

model DisableFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableFlowResponseBody(name='body'),
}

async function disableFlowWithOptions(request: DisableFlowRequest, runtime: Util.RuntimeOptions): DisableFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableFlow(request: DisableFlowRequest): DisableFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableFlowWithOptions(request, runtime);
}

model EnableFlowRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow that you want to enable.', example='tp-uf6pvud38xl0ia'),
}

model EnableFlowResponseBody = {
  flowStatus?: string(name='FlowStatus', description='The status of the workflow. Valid values:

*   **Enabled**: The workflow is enabled.
*   **Disabled**: The workflow is disabled.', example='Enabled'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values:

*   **true**: The operation was successful.
*   **false**: The operation failed.', example='true'),
}

model EnableFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableFlowResponseBody(name='body'),
}

async function enableFlowWithOptions(request: EnableFlowRequest, runtime: Util.RuntimeOptions): EnableFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableFlow(request: EnableFlowRequest): EnableFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableFlowWithOptions(request, runtime);
}

model GetFlowRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow.', example='lc-uf6pvud38xl0ia'),
}

model GetFlowResponseBody = {
  createTime?: string(name='CreateTime', description='The time when the workflow was created.', example='2019-07-19T05:43:16.783Z'),
  currentVersionId?: string(name='CurrentVersionId', description='The version ID of the workflow.', example='1'),
  definition?: string(name='Definition', description='The definition of the workflow.', example='{\\"schemaVersion\\":\\"2018-12-12\\",\\"actions\\":{},\\"version\\":\\"1.0.0\\",\\"triggers\\":{}}'),
  flowDescription?: string(name='FlowDescription', description='The description of the workflow.', example='This is a workflow.'),
  flowEditMode?: string(name='FlowEditMode', description='The edit mode of the workflow.', example='Locked'),
  flowId?: string(name='FlowId', description='The ID of the workflow.', example='lc-uf6pvud38xl0ia'),
  flowName?: string(name='FlowName', description='The name of the workflow.', example='test'),
  flowSource?: string(name='FlowSource', description='The source of the workflow.', example='CloudConfig'),
  flowStatus?: string(name='FlowStatus', description='The status of the workflow. Valid values:

*   **Enabled**: The workflow is enabled.
*   **Disabled**: The workflow is disabled.', example='Enabled'),
  regionId?: string(name='RegionId', description='The ID of the region where the workflow resides.', example='cn-shanghai'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmzyxxxxxxx'),
  templateId?: string(name='TemplateId', description='The template ID.', example='tp-uf6tbvhheciyxl'),
  updateTime?: string(name='UpdateTime', description='The time when the workflow was last updated.', example='2019-07-19T05:43:16.783Z'),
}

model GetFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFlowResponseBody(name='body'),
}

async function getFlowWithOptions(request: GetFlowRequest, runtime: Util.RuntimeOptions): GetFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFlow(request: GetFlowRequest): GetFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFlowWithOptions(request, runtime);
}

model GetTemplateRequest {
  templateId?: string(name='TemplateId', description='The ID of the template.', example='tp-uf6tbvhheciyxl'),
}

model GetTemplateResponseBody = {
  createTime?: string(name='CreateTime', description='The time when the template was created.', example='2020-08-19T03:31:32.415Z'),
  definition?: string(name='Definition', description='The definition of the template.', example='{"actions": {},"schemaVersion":"2018-12-12","version": "1.0.0"}'),
  regionId?: string(name='RegionId', description='The region where the template resides.', example='cn-shanghai'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BCF7212F-9478-569A-B57C-8C1B5A560C2F'),
  templateConnector?: string(name='TemplateConnector', description='A list of connectors that are used in the template. The connectors are separated by commas.', example='config,oss'),
  templateCreator?: string(name='TemplateCreator', description='The publisher of the template.', example='Logic Composer'),
  templateDescription?: string(name='TemplateDescription', description='A description of the template.', example='This template is used only for testing purposes.'),
  templateId?: string(name='TemplateId', description='The ID of the template.', example='tp-uf6tbvhheciyxl'),
  templateLocale?: string(name='TemplateLocale', description='The language that is used in the template. Chinese and English are supported.', example='zh'),
  templateName?: string(name='TemplateName', description='The name of the template.', example='test'),
  templateOverview?: string(name='TemplateOverview', description='An overview of the template, which is a JSON string.', example='[]'),
  templateSummary?: string(name='TemplateSummary', description='A brief introduction to the template.', example='This is a test template.'),
  templateSummaryEn?: string(name='TemplateSummaryEn', description='A brief introduction to the template.', example='This is a test template'),
  templateTag?: string(name='TemplateTag', description='The tag of the template.', example='test,owner'),
  templateVersion?: int32(name='TemplateVersion', description='The version of the template, which is a number that increments from 0.', example='0'),
  updateTime?: string(name='UpdateTime', description='The time when the template was last updated.', example='2020-08-19T03:31:32.415Z'),
}

model GetTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTemplateResponseBody(name='body'),
}

async function getTemplateWithOptions(request: GetTemplateRequest, runtime: Util.RuntimeOptions): GetTemplateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.templateId)) {
    body['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTemplate',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTemplate(request: GetTemplateRequest): GetTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTemplateWithOptions(request, runtime);
}

model GetVersionRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow.', example='lc-uf6axpwfcw4ubx'),
  versionId?: string(name='VersionId', description='The ID of the version.', example='10'),
}

model GetVersionResponseBody = {
  createTime?: string(name='CreateTime', description='The time when the version was created.', example='2018-12-12T07:36:22.992Z'),
  definition?: string(name='Definition', description='The definition of the workflow to which the version belongs.', example='{\\"schemaVersion\\":\\"2018-12-12\\",\\"actions\\":{},\\"version\\":\\"1.0.0\\",\\"triggers\\":{}}'),
  flowId?: string(name='FlowId', description='The ID of the workflow to which the version belongs.', example='lc-uf6wvbsyvvl5sy'),
  regionId?: string(name='RegionId', description='The region where the workflow resides.', example='cn-shanghai'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  updateTime?: string(name='UpdateTime', description='The time when the version was last updated.', example='2018-12-12T07:36:22.992Z'),
  versionDescription?: string(name='VersionDescription', description='The description of the version.', example='This is the description of the version.'),
  versionId?: string(name='VersionId', description='The ID of the version.', example='10'),
  versionName?: string(name='VersionName', description='The name of the version.', example='5.3.6'),
  versionStatus?: string(name='VersionStatus', description='The status of the version. **Enabled** indicates that the version is enabled.', example='Enabled'),
}

model GetVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetVersionResponseBody(name='body'),
}

async function getVersionWithOptions(request: GetVersionRequest, runtime: Util.RuntimeOptions): GetVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!Util.isUnset(request.versionId)) {
    body['VersionId'] = request.versionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetVersion',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getVersion(request: GetVersionRequest): GetVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getVersionWithOptions(request, runtime);
}

model GroupInvokeFlowRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.', example='abcdefghijklmn'),
  data?: string(name='Data', description='The information required by the group execution. Set this parameter to a JSON array of strings in the following format:`{"Items": []}`. Each string provides the information required by one time of execution. The string must use the format of the Data parameter in the InvokeFlow operation.', example='{\\"Items\\":[{\\"resourceId\\":\\"i-bp1383wskmaa65duviwh\\",\\"regionId\\":\\"cn-hangzhou\\",\\"resourceType\\":\\"ACS::ECS::Instance\\"}],\\"Source\\":\\"CloudConfig\\"}'),
  flowId?: string(name='FlowId', description='The ID of the workflow that you want to execute.', example='lc-uf6axpwfcw4ubx'),
  groupKey?: string(name='GroupKey', description='The name of the group. The name must be unique among the groups.', example='1632117849243'),
  tags?: string(name='Tags', description='The tag that is attached to each time of execution. The value is a JSON array. The number of tags in the array is the same as the value of the TotalCount parameter.', example='[{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}]'),
  totalCount?: int32(name='TotalCount', description='The number of times of execution. The value must be the same as the number of strings in the value of the Data parameter.', example='1'),
}

model GroupInvokeFlowResponseBody = {
  currentCount?: int32(name='CurrentCount', description='The number of times of execution that are pending.', example='10'),
  groupInvocationId?: string(name='GroupInvocationId', description='The unique identifier of the execution.', example='7bdbdb58-f028-4155-915e-f21e1f8fc48a'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4F06F96E-D1F8-54ED-9611-4F621AD899B5'),
  status?: string(name='Status', description='The status of the group. Valid values:

*   New: The group is created and waiting to be executed.
*   Started: The group is being executed.
*   Canceled: The group was canceled.
*   Failed: The execution failed.
*   Completed: All the times of execution in the group are complete.
*   Unknown: The group status is uncertain. In this case, a system error may occur.
*   TimedOut: The execution timed out.
*   Paused: The execution was suspended.', example='Completed'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful.

*   **true**: The workflow execution is triggered.
*   **false**: The workflow execution failed to be triggered.

> : You can call the **GetInvocationLog** operation to check whether the workflow execution is successful.', example='true'),
}

model GroupInvokeFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GroupInvokeFlowResponseBody(name='body'),
}

/**
  * *   You can call this operation to trigger a workflow to be executed more than 100 times per second. If the desired execution frequency does not exceed 100 times per second, we recommend that you call the InvokeFlow operation.
  * *   However, you may need to call the GroupInvokeFlow operation multiple times. For example, assume that you want a workflow to be executed 1,000 times per second and the 1,000 times of execution are divided into ten groups. You need to call the operation ten times for the ten groups and specify a group key for each group.
  * *   Each call corresponds to a group execution. Logic Composer automatically determines when a group execution starts. You must set the Data parameter to a JSON array of strings to specify the information required by the execution. Each string provides the information required by one time of execution. The string must use the format of the Data parameter in the InvokeFlow operation.
  *
  * @param request GroupInvokeFlowRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return GroupInvokeFlowResponse
 */
async function groupInvokeFlowWithOptions(request: GroupInvokeFlowRequest, runtime: Util.RuntimeOptions): GroupInvokeFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!Util.isUnset(request.groupKey)) {
    body['GroupKey'] = request.groupKey;
  }
  if (!Util.isUnset(request.totalCount)) {
    body['TotalCount'] = request.totalCount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GroupInvokeFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * *   You can call this operation to trigger a workflow to be executed more than 100 times per second. If the desired execution frequency does not exceed 100 times per second, we recommend that you call the InvokeFlow operation.
  * *   However, you may need to call the GroupInvokeFlow operation multiple times. For example, assume that you want a workflow to be executed 1,000 times per second and the 1,000 times of execution are divided into ten groups. You need to call the operation ten times for the ten groups and specify a group key for each group.
  * *   Each call corresponds to a group execution. Logic Composer automatically determines when a group execution starts. You must set the Data parameter to a JSON array of strings to specify the information required by the execution. Each string provides the information required by one time of execution. The string must use the format of the Data parameter in the InvokeFlow operation.
  *
  * @param request GroupInvokeFlowRequest
  * @return GroupInvokeFlowResponse
 */
async function groupInvokeFlow(request: GroupInvokeFlowRequest): GroupInvokeFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return groupInvokeFlowWithOptions(request, runtime);
}

model InvokeFlowRequest {
  clientToken?: string(name='ClientToken', description='The token that is used to guarantee idempotence to avoid repeated operations.', example='abcdefghijklmn'),
  data?: string(name='Data', description='The data for invoking the workflow.', example='{"body": {"test": true}}'),
  flowId?: string(name='FlowId', description='The parameters required by the template, which must be in JSON format.', example='lc-abcdefg'),
  parameters?: string(name='Parameters', description='The input parameters required by the trigger of the workflow execution, which must be in JSON format.', example='{"ParamA": "test"}'),
}

model InvokeFlowResponseBody = {
  invocationId?: string(name='InvocationId', description='The unique identifier of the execution.', example='6b387696-d160-4ed7-xxxx-070ac29dce4d'),
  requestId?: string(name='RequestId', description='The ID for this request.', example='5CE7EAE6-XXXX-XXXX-A1A3-D3C2AE624000'),
  success?: boolean(name='Success', description='Indicates whether the workflow execution was triggered.

*   **true**: The workflow execution was triggered
*   **false**: The workflow execution failed to be triggered.

> : You can call the **GetInvocationLog** operation to check whether the workflow execution is successful.', example='true'),
}

model InvokeFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: InvokeFlowResponseBody(name='body'),
}

async function invokeFlowWithOptions(request: InvokeFlowRequest, runtime: Util.RuntimeOptions): InvokeFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!Util.isUnset(request.parameters)) {
    body['Parameters'] = request.parameters;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'InvokeFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function invokeFlow(request: InvokeFlowRequest): InvokeFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return invokeFlowWithOptions(request, runtime);
}

model ListFlowsRequest {
  filter?: string(name='Filter', description='The filter condition, which is in the JSON format of {"key":"value"}. Example: {"key1":"value1"}', example='{\\"tags\\":[{\\"key\\":\\"acs:lc:Solution:AliyunSSO\\",\\"value\\":\\"AzureAD\\"}]}'),
  flowName?: string(name='FlowName', description='The name of the workflow.', example='test'),
  pageNumber?: int32(name='PageNumber', description='The page number of the current page. Minimum value: 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='Specifies the number of workflows to return on each page. A page can contain a maximum of 100 workflows. Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmzy6dzs6qtqa'),
}

model ListFlowsResponseBody = {
  flows?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the workflow was created.', example='2019-07-19T05:43:16.783Z'),
      flowDescription?: string(name='FlowDescription', description='The description of the workflow.', example='test flow'),
      flowEditMode?: string(name='FlowEditMode', description='The edit mode of the workflow.', example='Normal'),
      flowId?: string(name='FlowId', description='The ID of the workflow.', example='lc-uf6axpwfcw4ubx'),
      flowName?: string(name='FlowName', description='The name of the workflow.', example='test'),
      flowSource?: string(name='FlowSource', description='The source of the workflow.', example='Solution'),
      flowStatus?: string(name='FlowStatus', description='The status of the workflow. Valid values:

*   **Enabled**: The workflow is enabled.
*   **Disabled**: The workflow is disabled.', example='Enabled'),
      regionId?: string(name='RegionId', description='The region to which the workflow belongs.', example='cn-shanghai'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmzyxxxxxxx'),
      templateId?: string(name='TemplateId', description='The template ID. You can call the ListTemplates operation to obtain the template ID.', example='tp-uf6lzhzywy28bs'),
      updateTime?: string(name='UpdateTime', description='The time when the workflow was last updated.', example='2019-07-19T05:43:16.783Z'),
      versionId?: string(name='VersionId', description='The latest version of the workflow.', example='1'),
    }
  ](name='Flows', description='A list of workflows.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A4865221-E0BC-5AF6-BDD3-749F5A2371CC'),
  totalCount?: int32(name='TotalCount', description='The total number of workflows in the current region.', example='1'),
}

model ListFlowsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListFlowsResponseBody(name='body'),
}

async function listFlowsWithOptions(request: ListFlowsRequest, runtime: Util.RuntimeOptions): ListFlowsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.filter)) {
    body['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.flowName)) {
    body['FlowName'] = request.flowName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListFlows',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFlows(request: ListFlowsRequest): ListFlowsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFlowsWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of results to return on each page.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used to start the next query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  resourceId?: [ string ](name='ResourceId', description='A list of resource IDs.'),
  resourceType?: string(name='ResourceType', description='The type of the resources. Set the value to ALIYUN::LC::FLOW.

*   ALIYUN::LC::FLOW indicates Logic Composer workflows.', example='ALIYUN::LC::FLOW'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='testkey'),
      value?: string(name='Value', description='The value of the tag.', example='testvalue'),
    }
  ](name='Tag', description='A list of tags that are attached to the resources. A list can contain a maximum of 20 tags.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The token that is used to start the next query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C9025B15-16CC-53FB-B7B1-7295AA010EBD'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='lc-0xiisfk685vhfk'),
      resourceType?: string(name='ResourceType', description='The type of the resource.

*   Valid value: ALIYUN::LC::FLOW', example='ALIYUN::LC::FLOW'),
      tagKey?: string(name='TagKey', description='The key of the tag.', example='testkey'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='testvalue'),
    }
  ](name='TagResources', description='The mappings between resources and tags.'),
  totalCount?: int32(name='TotalCount', description='The total number of resources.', example='2'),
}

model ListTagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTagResourcesResponseBody(name='body'),
}

async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListTemplatesRequest {
  lang?: string(name='Lang', description='The language that is used in the templates.', example='zh'),
  name?: string(name='Name', description='The keyword that is used to search for templates. This parameter is invalid if you specify a tag.', example='test'),
  pageNumber?: int32(name='PageNumber', description='The page number of current page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of templates on each page. A page can contain a maximum of 100 templates. Default value: 10.', example='10'),
  tag?: string(name='Tag', description='The tag that is used to search for templates.', example='{"key": "a","value":"b"}'),
}

model ListTemplatesResponseBody = {
  requestId?: string(name='RequestId', description='The unique identifier of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  templates?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the template was created.', example='2020-08-19T03:31:32.415Z'),
      templateConnector?: string(name='TemplateConnector', description='A list of connectors that are used in the template. The connectors are separated by commas.', example='oss,rds'),
      templateCreator?: string(name='TemplateCreator', description='The publisher of the template.', example='Logic Composer'),
      templateDescription?: string(name='TemplateDescription', description='A brief introduction to the template.', example='This is a test template.'),
      templateId?: string(name='TemplateId', description='The ID of the template.', example='tp-uf6tbvhheciyxl'),
      templateLocale?: string(name='TemplateLocale', description='The language that is used in the template. Chinese and English are supported.', example='zh'),
      templateName?: string(name='TemplateName', description='The name of the template.', example='test'),
      templateOverview?: string(name='TemplateOverview', description='An overview of the template, which is a JSON string.', example='[]'),
      templateSummary?: string(name='TemplateSummary', description='A description of the template.', example='This is a test template.'),
      templateSummaryEn?: string(name='TemplateSummaryEn', description='A brief introduction to the template.', example='This is a test template'),
      templateTag?: string(name='TemplateTag', description='The tag of the template.', example='finance'),
      templateVersion?: int32(name='TemplateVersion', description='The version of the template, which is a number that increments from 0.', example='0'),
      updateTime?: string(name='UpdateTime', description='The time when the template was last updated.', example='2020-08-19T03:31:32.415Z'),
    }
  ](name='Templates', description='A list of templates.'),
  totalCount?: int32(name='TotalCount', description='The total number of templates.', example='10'),
}

model ListTemplatesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTemplatesResponseBody(name='body'),
}

async function listTemplatesWithOptions(request: ListTemplatesRequest, runtime: Util.RuntimeOptions): ListTemplatesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.lang)) {
    body['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTemplates',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTemplates(request: ListTemplatesRequest): ListTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplatesWithOptions(request, runtime);
}

model ListVersionsRequest {
  flowId?: string(name='FlowId', description='The ID of the workflow whose versions you want to query.', example='lc-uf6axpwfcw4ubx'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page to return. The value must be an integer that is greater than 0. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of versions to return on each page. One page contains a maximum of 100 versions. Default value: 10.', example='10'),
}

model ListVersionsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  totalCount?: int32(name='TotalCount', description='The total number of versions of the workflow.', example='1'),
  versions?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the version was created.', example='2018-12-12T07:36:22.992Z'),
      flowId?: string(name='FlowId', description='The ID of the workflow to which the version belongs.', example='lc-uf6axpwfcw4ubx'),
      updateTime?: string(name='UpdateTime', description='The time when the version was last updated.', example='2018-12-12T07:36:22.992Z'),
      versionId?: string(name='VersionId', description='The ID of the version.', example='1'),
      versionName?: string(name='VersionName', description='The name of the version.', example='1'),
      versionNumber?: int32(name='VersionNumber', description='The number of the version. Increment from 1.', example='4'),
      versionStatus?: string(name='VersionStatus', description='The status of the version. **Enabled** indicates that the version is enabled.', example='Enabled'),
    }
  ](name='Versions', description='A list of the versions.'),
}

model ListVersionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListVersionsResponseBody(name='body'),
}

async function listVersionsWithOptions(request: ListVersionsRequest, runtime: Util.RuntimeOptions): ListVersionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListVersions',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listVersions(request: ListVersionsRequest): ListVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listVersionsWithOptions(request, runtime);
}

model TagResourcesRequest {
  resourceId?: [ string ](name='ResourceId', description='Specifies a maximum of 50 resource IDs.', example='lc-uf6tbvhheciyxl'),
  resourceType?: string(name='ResourceType', description='The type of the resources. Set the value to ALIYUN::LC::FLOW.

*   ALIYUN::LC::FLOW indicates Logic Composer workflows.', example='ALIYUN::LC::FLOW'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='tagKey'),
      value?: string(name='Value', description='The value of the tag.', example='tagValue'),
    }
  ](name='Tag', description='Specifies a list of tags that you want to attach to the resources.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model TagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TagResourcesResponseBody(name='body'),
}

async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='系统规定参数。取值：UntagResources。', example='false'),
  resourceId?: [ string ](name='ResourceId', description='The type of the resources. Set the value to ALIYUN::LC::FLOW.

*   ALIYUN::LC::FLOW indicates Logic Composer workflows.', example='lc-uf6tbvhheciyxl'),
  resourceType?: string(name='ResourceType', description='system', example='ALIYUN::LC::FLOW'),
  tagKey?: [ string ](name='TagKey', description='Specifies a maximum of 50 resource IDs.', example='tagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='Indicates whether the call was successful.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  success?: boolean(name='Success', description='The ID of the request.', example='true'),
}

model UntagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UntagResourcesResponseBody(name='body'),
}

async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    body['All'] = request.all;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    body['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateFlowRequest {
  definition?: string(name='Definition', description='The new definition that you want to specify for the workflow.', example='{\\"schemaVersion\\":\\"2018-12-12\\",\\"actions\\":{},\\"version\\":\\"1.0.0\\",\\"triggers\\":{}}'),
  flowDescription?: string(name='FlowDescription', description='The new description that you want to specify for the workflow.', example='This is the description of the workflow.'),
  flowId?: string(name='FlowId', description='The ID of the workflow whose information you want to update.', example='lc-uf6axpwfcw4ubx'),
  flowName?: string(name='FlowName', description='The new name that you want to specify for the workflow.', example='test'),
}

model UpdateFlowResponseBody = {
  currentVersionId?: int32(name='CurrentVersionId', description='The version ID of the workflow after the update.', example='ve-uf6bwdtvid7o25'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADB97A33-50E7-48A5-963D-ACBAE36D0BEC'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values:

*   **true**: The operation was successful.
*   **false**: The operation failed.', example='true'),
}

model UpdateFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateFlowResponseBody(name='body'),
}

async function updateFlowWithOptions(request: UpdateFlowRequest, runtime: Util.RuntimeOptions): UpdateFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.definition)) {
    body['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.flowDescription)) {
    body['FlowDescription'] = request.flowDescription;
  }
  if (!Util.isUnset(request.flowId)) {
    body['FlowId'] = request.flowId;
  }
  if (!Util.isUnset(request.flowName)) {
    body['FlowName'] = request.flowName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFlow',
    version = '2018-12-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFlow(request: UpdateFlowRequest): UpdateFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateFlowWithOptions(request, runtime);
}

